<template>
    <div style="margin: 50px">
        <div style="margin-bottom: 20px;">当前用户名:{{ userName }},当前时间：{{ date }}</div>
        <el-row>
            <el-button @click="getUserName">获取用户信息</el-button>
            <el-button type="primary">主要按钮</el-button>
            <el-button type="success">成功按钮</el-button>
            <el-button type="info">信息按钮</el-button>
            <el-button type="warning">警告按钮</el-button>
            <el-button type="danger">危险按钮</el-button>
        </el-row>

        <el-link href="https://element.eleme.io" target="_blank">默认链接</el-link>
        <el-link type="primary">主要链接</el-link>
        <el-link type="success">成功链接</el-link>
        <el-link type="warning">警告链接</el-link>
        <el-link type="danger">危险链接</el-link>
        <el-link type="info">信息链接</el-link>
    </div>
    <div><el-input placeholder="图片一" style="width: 200px" v-model="sbtp1" /></div>
    <div><el-input style="width: 200px">  </el-input></div>
    <div>
        <p> <a :href="dynamicLink" target="_blank">本文本</a> 是一个指向本网站中的一个页面的链接。</p>
    </div>

    <div>
        <label for="">设备名称</label>
        <el-input v-model="Sbmc" style="width: 200px;"></el-input>
        <el-button @click="clickEF" type="'primary'">EF访问数据库</el-button>
        <el-button @click="clickDapper" type="'primary'">Dapper访问数据库</el-button>
    </div>
</template>
<script>
import { da } from 'element-plus/es/locales.mjs';

export default {
    data() {
        return {
            userName: "",
            date: "",
            value: new Date(),
            drawer: false,
            Sbmc:'123'



        };
    },
    methods: {
        getUserName() {
            this.http.get("api/user/getUserName", {}, true).then(result => {
                this.userName = result.userName;
                this.date = result.date;
            })
        },

        clickEF(){
            let url="api/dbTest/ef?Sbmc="+this.Sbmc;
            this.http.get(url,{},true).then(((x)=>{

                    this.$Message.info(x);
                }
            ));
        },
        clickDapper(){

            let url="api/dbTest/dapper?Sbmc="+this.Sbmc;
            this.http.get(url,{},true).then(((x)=>{

                    this.$Message.info(x);
                }
            ));
            
        }





    },
    created() {
        this.getUserName();
    },

    props: ['param1', 'param2'],
    computed: {
        dynamicLink() {
            return `http://www.baidu.com`;
        }
    }
};
</script>
